package com.project.server.controller;

import com.project.server.common.api.Result;
import com.project.server.dto.DashboardDataDTO;
import com.project.server.service.DashboardService;
import com.project.server.vo.dashboard.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;


    @GetMapping("/statistics")
    public Result<DashboardDataDTO> getStatistics(@RequestParam(required = false) String timeRange) {
        return Result.success(dashboardService.getDashboardData(timeRange));
    }
}
